package com.realone.packman.codec.encoder;

import com.realone.packman.codec.BmsCodecConstant;

/**
 * @author hugx
 * @create 2018-09-13 17:35
 */
public class BmsEncoderFactory {

    public static BmsEncoder createBmsEncoder(byte cmd) {
        BmsEncoder bmsEncoder = null;
        switch (cmd) {
            case BmsCodecConstant.Req_Cmd_0x00:
                bmsEncoder = new BmsEncoder00();
                break;
            case BmsCodecConstant.Req_Cmd_0x01:
                bmsEncoder = new BmsEncoder01();
                break;
            case BmsCodecConstant.Req_Cmd_0x02:
                bmsEncoder = new BmsEncoder02();
                break;
            case BmsCodecConstant.Req_Cmd_0x03:
                bmsEncoder = new BmsEncoder03();
                break;
            case BmsCodecConstant.Req_Cmd_0x04:
                bmsEncoder = new BmsEncoder04();
                break;
            case BmsCodecConstant.Req_Cmd_0x05:
                bmsEncoder = new BmsEncoder05();
                break;
            case BmsCodecConstant.Req_Cmd_0x06:
                bmsEncoder = new BmsEncoder06();
                break;
            case BmsCodecConstant.Req_Cmd_0x07:
                bmsEncoder = new BmsEncoder07();
                break;
            case BmsCodecConstant.Req_Cmd_0x08:
                bmsEncoder = new BmsEncoder08();
                break;
            case BmsCodecConstant.Req_Cmd_0x09:
                bmsEncoder = new BmsEncoder09();
                break;
            case BmsCodecConstant.Req_Cmd_0x0a:
                bmsEncoder = new BmsEncoder0a();
                break;
            case BmsCodecConstant.Req_Cmd_0x0b:
                bmsEncoder = new BmsEncoder0b();
                break;
            case BmsCodecConstant.Req_Cmd_0x0c:
                bmsEncoder = new BmsEncoder0c();
                break;
            case BmsCodecConstant.Req_Cmd_0x0d:
                bmsEncoder = new BmsEncoder0d();
                break;

        }

        return bmsEncoder;
    }
}
